package com.sc.service.goods;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sc.dal.mapper.goods.GoodsHotwordsMapper;
import com.sc.dal.model.goods.GoodsHotwords;

/**
 * 商品热门词汇服务实现
 * @author maoyongbin
 * @日期 Mar 13, 2017 4:55:21 PM
 */
@Service
public class GoodsHotwordsService {
	@Autowired
	private GoodsHotwordsMapper goodsHotwordsMapper;

	/**
     * 查找所有商品品牌
     * @return List<GoodsHotwords>
     */
    public List<GoodsHotwords> select(){
    	List<GoodsHotwords> goodsHotwordsList = this.goodsHotwordsMapper.select();
    	
    	return goodsHotwordsList;
    }
    
    /**
	  * <h2>取得商品品牌实体对象数据</h2>
	  * @Title: getGoodsHotwordsData
	  * @Description: 取得商品品牌实体对象数据
	  * @param @param GoodsHotwords
	  * @return Map<String,Object>    返回类型
	 */
	public List<Object> getGoodsHotwordsData(List<GoodsHotwords> goodsHotwordsList){
		List<Object> goodsHotwordsMapList = new ArrayList<Object>();
		for(GoodsHotwords goodsHotwords : goodsHotwordsList){
			Map<String,Object> dataMap = new LinkedHashMap<String,Object>();
			dataMap.put("id",goodsHotwords.getId());
			dataMap.put("name",goodsHotwords.getName());
			dataMap.put("position",goodsHotwords.getPosition());
			
			goodsHotwordsMapList.add(dataMap);
		}
		
		return goodsHotwordsMapList;
	}
}
